package cn.edu.xmu.datamining.tangzk.mralgos.kmeans;

import org.apache.hadoop.mapreduce.Partitioner;

public class KMeansPartitioner extends
		Partitioner<ClusterCentroidWritable, SampleWritable> {

	@Override
	public int getPartition(ClusterCentroidWritable key, SampleWritable value,
			int numPartitions) {
		// key.getC() always greater than 0.
		return key.getC() % numPartitions;
	}

}
